package com.geo.smallcredit.fragment;

import java.util.List;

import com.geo.smallcredit.R;
import com.geo.smallcredit.vo.Home_score_DetailVo;
import com.geo.smallcredit.vo.Home_score_DetailVo.Home_score_list;

import android.content.pm.ApplicationInfo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class Livyue_descriptionFragment extends Fragment {
	private View view;
	private Home_score_DetailVo hd;
	private TextView title,content;
//	private ImageView icon;
	private String icons,desc,attribute;
	private int position;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		view=inflater.inflate(R.layout.livyue_fragment,null);
		 initview();
		Bundle bundle=getArguments();   
		hd=(Home_score_DetailVo) bundle.getSerializable("mec");
		position=bundle.getInt("position");
		int code=hd.getErrno();
		if(code==200){
			List<Home_score_list>  hl=hd.getData().get(0).getAttributes();
			icons=hl.get(3).getIcon();
			desc=hl.get(3).getDesc();
			attribute=hl.get(3).getAttribute();
			title.setText(attribute);
			content.setText(desc);
//			ApplicationInfo appInfo = getActivity().getApplicationInfo();
//			int id=getResources().getIdentifier(icons, "drawable", appInfo.packageName);
//			icon.setImageResource(id);
		}
		return view;
	}
	private void initview(){
		title=(TextView) view.findViewById(R.id.company_livyue_title);
		content=(TextView) view.findViewById(R.id.company_livyue_content);
//		icon=(ImageView) view.findViewById(R.id.company_livyue_img);
	}
}
